//
//  OrderInfoTableViewController.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/8.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "OrderInfoTableViewController.h"
#import "DistributionInfoTableViewCell.h"
#import "GoodInfoTableViewCell.h"
#import "CostInfoTableViewCell.h"
#import "OrderInfoTableViewCell.h"

@interface OrderInfoTableViewController ()

@property (nonatomic, strong)NSDictionary *dic1;
@property (nonatomic, strong)NSDictionary *dic2;
@property (nonatomic, strong)NSDictionary *dic3;
@property (nonatomic, strong)NSDictionary *dic4;

- (IBAction)back:(id)sender;
@end

@implementation OrderInfoTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

//懒加载
- (NSDictionary *)dic1
{
    if (!_dic1) {
        _dic1 = @{@"name":@"1111",@"iphone":@"112112211",@"address":@"南京玄武区珠江路新世界大厦B座",@"time":@"周一到周五"};
    }
    return _dic1;
}
- (NSDictionary *)dic2
{
    if (!_dic2) {
        _dic2 = @{@"image":@"logo",@"discri":@"描述详细的商品信息!",@"money":@"200积分+90元",@"amount":@"X1",@"number":@"共1件"};
    }
    return _dic2;
}
- (NSDictionary *)dic3
{
    if (!_dic3) {
        _dic3 = @{@"all":@"￥90.00",@"integral":@"200",@"freight":@"00:00",@"commission":@"00:00",@"tax":@"00:00",@"realPay":@"00:00"};
    }
    return _dic3;
}
- (NSDictionary *)dic4
{
    if (!_dic4) {
        _dic4 = @{@"ordernumber":@"11111111",@"time":@"2015/11/26",@"state":@"买家还未付款"};
    }
    return _dic4;
}

- (IBAction)back:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}


//数据源方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
        DistributionInfoTableViewCell *cell = [DistributionInfoTableViewCell DistributionInfoWithTableView:tableView];
        cell.dic = self.dic1;
        return cell;
    }else if (indexPath.row == 1)
    {
        GoodInfoTableViewCell *cell = [GoodInfoTableViewCell GoodInfoWithTableView:tableView];
        cell.dic = self.dic2;
        return cell;
    }else if (indexPath.row == 2)
    {
        CostInfoTableViewCell *cell = [CostInfoTableViewCell CostInfoWithTableView:tableView];
        cell.dic = self.dic3;
        return cell;
    }else
    {
        OrderInfoTableViewCell *cell = [OrderInfoTableViewCell OrderInfoWithTableView:tableView];
        cell.dic = self.dic4;
        return cell;
    }
}

//设置行高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        return 150;
    }else if (indexPath.row == 1)
    {
        return 120;
    }else if (indexPath.row == 2)
    {
        return 210;
    }else
    {
        return 100;
    }
}

//隐藏状态栏
-(UIStatusBarStyle)preferredStatusBarStyle
{
    return YES;
}
@end
